package com.ruoyi.mp.handler.task;

import com.ruoyi.mp.handler.MsgHandler;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class DailyResetTask {

    private final MsgHandler msgHandler;

    public DailyResetTask(MsgHandler msgHandler) {
        this.msgHandler = msgHandler;
    }

    @Scheduled(cron = "0 0 0 * * ?") // 每天午夜执行
    public void resetRequestCounts() {
        msgHandler.resetRequestCounts();
    }
}

